# -*- coding: utf-8 -*-
"""
@Time : 2023/6/11 22:05
@Author : Gremore
@File : time_utils
@Des: 
"""
import time
from datetime import datetime


def timestamp_to_datetime2(ts):
    """
	时间戳转日期时间
	:param ts: 时间戳
	:return:
	"""
    dt = datetime.strptime(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(ts)), "%Y-%m-%d %H:%M:%S")
    return dt


def timestamp_to_datetime(timestamp):
    """
    时间戳转datetime
    :param timestamp:
    :return: datetime
    """
    result = datetime.fromtimestamp(timestamp)
    return result
